package com.example.final_project.mapper;

import com.example.final_project.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface OrderDetailMapper {
    // 批量新增订单详情
    int batchInsert(@Param("list") List<OrderDetail> list);
    
    // 删除订单详情
    int deleteByOrderId(Long orderId);
    
    // 根据订单ID查询订单详情
    List<OrderDetail> selectByOrderId(Long orderId);

    // 根据用户ID查询其已购买的所有教材ID
    List<Long> findBookIdsByUserId(@Param("userId") Long userId);
} 